Phase error detection in phase lock loop and delay lock loop devices

ABSTRACT

A device includes a lock detect circuit that is structured and arranged to: convert a reference clock to a reference triangle wave; convert a feedback clock to a feedback triangle wave; determine whether the feedback triangle wave is within a tolerance margin that is defined relative to the reference triangle wave; and generate a determiner output that is a first value when the feedback triangle wave is not within the tolerance margin, and a second value when the feedback triangle wave is within the tolerance margin.

FIELD OF THE INVENTION

The invention relates to phase error detection and, more particularly,to phase error detection in phase lock loop and delay lock loop devices.

BACKGROUND

Phase error (phase offset) is the time difference between relevant edgesof the reference input clock and the feedback input to the phasedetector of a phase lock loop (PLL). There are two type of phase error:static phase error and dynamic phase error. Static phase error is thetime difference between the averaged input reference clock and theaveraged feedback input signal when the PLL is in locked mode. Staticphase error excludes jitter components. Dynamic phase error is the phasedifference between the input clock and output clock due to inability ofthe PLL to instantaneously update the output clock when the period ofthe input clock changes. Dynamic phase error is also referred to astracking skew, and includes jitter.

Phase jitter is the deviation in static phase offset for a controllededge with respect to a mean value of static phase offset. Static phaseerror is caused by non-ideal elements in the PLL, such as the chargepump, phase detector, dividers in path, etc. Dynamic phase error iscaused by reference clock jitter, VCO jitter, supply noise variations,etc. While zero phase error is ideal, the realistic offset for any PLLsystem is a measure of the ability of the loop to align the phases ofthe reference clock to the feedback clock. The wider this offset, thewider the phase relationship of a PLL output clock to the referenceclock. The magnitude of the variation of phase offset is thus defined asphase jitter.

A lock detect circuit may be used to determine the lock state of a PLL.Information regarding the lock state of a PLL is used in a variety ofapplications, such as a macro test pass/fail criteria for manufacturingscreen of wafers and modules in test. The lock signal may also be usedas an indicator to a higher level system that stable clocking has beenachieved and hence subsequent operations may be performed. Duringpower-up or event changes (such as reference clock frequencychange/divider value change/output frequency change) the PLL mustachieve a lock state before the PLL clock signals or derivatives aresuitable for use in downstream processing. Downstream circuits may go onstandby mode for a preprogrammed wait time while the PLL is achievinglock.

Lock detect circuits are typically implemented as pure digital circuitsthat use digital counters. The counters generate pulses on differentcount codes and ensure that those pulses do not overlap. However, nopulses are generated at times when no feedback clock is present, whichmay cause the lock indicator to falsely report a lock condition.

SUMMARY

In a first aspect of the invention, there is a device including a lockdetect circuit that is structured and arranged to: convert a referenceclock to a reference triangle wave; convert a feedback clock to afeedback triangle wave; determine whether the feedback triangle wave iswithin a tolerance margin that is defined relative to the referencetriangle wave; and generate a determiner output that is a first valuewhen the feedback triangle wave is not within the tolerance margin and asecond value when the feedback triangle wave is within the tolerancemargin.

In another aspect of the invention, there is a lock detect circuitincluding: a first ramp generator that converts a reference clock to areference triangle wave; and a second ramp generator that converts afeedback clock to a feedback triangle wave. The lock detect circuit alsoincludes a first margin setter that generates: a first margin signalthat defines an upper bound of a tolerance margin relative to thereference triangle wave, and a second margin signal that defines a lowerbound of the tolerance margin relative to the reference triangle wave.The lock detect circuit further includes: a second margin setter thatgenerates a comparison triangle wave based on the feedback trianglewave; a determiner circuit that continuously compares the comparisontriangle wave to the first margin signal and the second margin signaland that generates a determiner output based on the comparing; and alock signal generation unit that generates a lock detect signal based onthe determiner output.

In another aspect of the invention, there is a method of lock detectionincluding: converting a reference clock to a reference triangle wave;converting a feedback clock to a feedback triangle wave; generating afirst margin signal that defines an upper bound of a tolerance marginrelative to the reference triangle wave; generating a second marginsignal that defines a lower bound of the tolerance margin relative tothe reference triangle wave; generating a comparison triangle wave basedon the feedback triangle wave; continuously comparing the comparisontriangle wave to the first margin signal and the second margin signal;generating a determiner output based on the comparing; and generating alock detect signal based on the determiner output.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The present invention is described in the detailed description whichfollows, in reference to the noted plurality of drawings by way ofnon-limiting examples of exemplary embodiments of the present invention.

FIG. 1 shows a phase lock loop;

FIG. 2 shows a digital lock detect circuit;

FIG. 3a shows an analog lock detect circuit in accordance with aspectsof the invention;

FIG. 3b shows output signals of a margin setter of the lock detectcircuit in accordance with aspects of the invention; and

FIG. 4 shows a block diagram of a ramp generator in accordance withaspects of the invention;

FIG. 5 shows a triangle wave converter usable in aspects of theinvention; and

FIG. 6 shows a flow diagram of a method in accordance with aspects ofthe invention.

DETAILED DESCRIPTION

The invention relates to phase error detection and phase-frequency lockindication and, more particularly, to phase error detection andphase-frequency lock indication in phase lock loop and delay lock loopdevices. According to aspects of the invention, analog circuitry is usedto compare the phase of a feedback clock and a reference clock usingtriangular profiles of the clocks. In embodiments, an analog lock detectcircuit is configured to: convert square/sinusoidal waves of a referenceclock and a feedback clock to respective triangle waves; create a firstmargin signal and a second margin signal around the reference clocktriangle wave; determine in real time whether the feedback clocktriangle wave is between the first margin signal and the second marginsignal; and generate a lock signal indicating a system lock when thefeedback clock triangle wave remains between the high margin signal andthe low margin signal for a predetermined amount of time. In thismanner, aspects of the invention provide an analog implementation of aphase error detector that is suited for use with phase lock loop anddelay lock loop devices.

As described herein, implementations of a lock detect circuit inaccordance with aspects of the invention include both frequency andphase match indications, as opposed to separate frequency only lockindicators and phase only lock indicators. Implementations of theinvention advantageously provide a high accuracy for defined margin.Implementations of the invention also advantageously avoid false lockindications that may occur in digital lock detect circuits. This is dueto the analog lock detect circuit of the present invention utilizing thefeedback clock, and only indicating a lock state when a triangle wavegenerated by the feedback clock falls within a tolerance margin definedby an upward offset and a downward offset applied to a triangle wavegenerated by the reference clock. Implementations of the invention alsoadvantageously provide tunable tolerance settings in that the tolerancemargin defined by upward offset and a downward offset can beprogrammed/changed.

FIG. 1 shows an exemplary phase lock loop (PLL) 10. The PLL 10 is acontrol circuit that generates an output signal “PLLCLK” whose phase isrelated to the phase of an input signal “REFCLK”. The PLL 10 shown inFIG. 1 includes: a phase frequency detector “PD”; a charge pump “CP”; afilter “Filter”; a voltage control oscillator “VCO”; a forward divider“DF”; a feedback divider “DB”; and a lock detector “LD”. The lockdetector LD (also called a lock indicator or a lock detect circuit) is acircuit used to identify frequency and/or phase lock in the PLL 10. Thelock detector LD receives REFCLK and a feedback clock “FBKCLK” asinputs, and outputs a lock signal “LOCK” as a high or low value (e.g., 1or 0) that indicates whether the PLL 10 has achieved frequency and/orphase lock.

FIG. 2 shows an exemplary digital lock detect circuit 20 that may beused as the lock detector LD of FIG. 1. The lock detect circuit 20includes: counters 25 a, 25 b that receive REFCLK and FBKCLK; timers 30a, 30 b; lock detectors 35 a, 35 b; a compare circuit 40, and an ANDgate 45 that outputs LOCK. When LOCK is high, this indicates the PLL isfrequency locked to the selected reference clock. To determine thislocked condition, the reference clock and the feedback clock are inputinto respective counters, for example a 3-bit counters. The 3-bitcounters are initialized at different values with a separation of say,two. When the 3-bit counters do not equal each other within a specifiedtimeout period, LOCK is asserted high to indicate lock. For each timedomain (the reference clock and the feedback clock), the timeout periodis implemented with an longer counter, for example a 11-bit counterrunning off its respective clock. The accuracy or resolution of thiscalculation is determined by the 3-bit counters separation divided bythe timeout period. If either the reference clock or the feedback clockstops running but not both, LOCK is forced low which indicates aproblem.

Low precision digital lock indicators do not take precision of frequencyand phase settling into account, and these circuits usually placeseveral disclaimers on the usage of the lock signal. Highly precisedigital lock indicators, on the other hand, have a tight window withinwhich frequency and/or phase deviations are permitted to occur. Thedefinition of the acceptable margin is one of the specifications of thelock detection circuit and the overall PLL architecture. The margintakes into account the allowable VCO jitter, reference clock jitter, andsupply noise variation tolerable by the PLL application. The downstreamapplication may be able to tolerate a certain percentage of frequency orphase deviation; however, when the lock indicator has a tighter marginit can hinder the system by indicating a loss of phase/frequency lockeven though the system is capable of handling the offset.

FIG. 3a shows an exemplary analog lock detect circuit 300 that may beused as the lock detector in a PLL or a delay lock loop (DLL) inaccordance with aspects of the invention. For example, the lock detectcircuit 300 may be used as the lock detector LD of FIG. 1. According toaspects of the invention, the lock detect circuit 300 is structured andarranged such that the time period information of the reference clockand the feedback clock are translated into the voltage domain. Inembodiments, the translation is achieved by converting the square orsinusoidal wave clocks (i.e., the reference clock and the feedbackclock) into triangle waves while maintaining the frequency and phaserelationships of the original reference and feedback clocks. Eachtriangle wave has a rising slope for one period of the clock and asimilar falling slope for the next adjacent cycle of that clock.

Implementations of the lock detect circuit 300 advantageously utilize atriangle wave profile because a DC-shifted copy of a triangle wave has aconstant voltage difference from the original triangle wave at any giventime. In embodiments, DC-shifting the reference clock based trianglewave is used to set the margin of tolerance for the frequency and phasemismatch. While other kinds of waves (such a saw-tooth or square wave)can also be DC-shifted, the waveforms have sharp high slew transitionsin one or both edges and thus create discontinuities in the acceptablemargin profile. Accordingly, the triangle wave profile is preferred toprovide a consistent margin profile that has smooth transitions.However, the invention is not limited to use with a triangle wave, andany suitable wave that accomplishes the functions described herein maybe used in implementations of the invention.

With continued reference to FIG. 3a , the lock detect circuit 300includes: ramp generators 305 a, 305 b; margin setters 310 a, 310 b;comparators 315 a, 315 b; OR gate 320; and a lock signal generation unit325. According to aspects of the invention, the ramp generators 305 a,305 b comprise analog circuitry that converts the square/sinusoidal wavesignals REFCLK and FBKCLK to triangle wave signals REF_ramp andFBK_ramp. Specifically, each of the ramp generators 305 a, 305 b createsa linearly rising ramp for the entire period of its respective inputclock, and a linearly falling ramp of same rate for the next adjacentcycle of its respective input clock. In embodiments, the ramp generator305 a is identical to the ramp generator 305 b for the purpose ofproviding the same triangle wave conversion to each of REFCLK and FBKCLKsince any difference in the respective conversions may introduce errorinto the system. Exemplary circuitry for each of the ramp generators 305a, 305 b is described herein with respect to FIGS. 4 and 5, althoughother suitable ramp generation circuitry may be used.

In embodiments, the margin setter 310 a shown in FIG. 3a comprisesanalog circuitry that receives the triangle wave signal REF_ramp as aninput and generates REF_hi, REF_mid, and REF_lo signals as outputs.REF_mid is a triangle wave that is equivalent in magnitude and period toREF_ramp and including any delay (e.g., time shift) of the margin setter310 a.

As shown in FIG. 3b , REF_hi tracks REF_mid and is DC-shifted higherthan REF_mid by a voltage offset amount Vup. Accordingly, REF_hi is atriangle wave that has the same frequency and same phase as REF_mid, andwhose value at any given time equals the value of REF_mid at the samevoltage shifted upward by the offset amount Vup. As shown in FIG. 3b ,REF_lo tracks REF_mid is DC-shifted lower than REF_mid by a voltageoffset amount Vdn. Accordingly, REF_lo is a triangle wave that has thesame frequency and same phase as REF_mid, and whose value at any giventime equals the value of REF_mid at the same voltage shifted downward bythe offset amount Vdn. The offset amounts Vup, Vdn of the DC-shiftvalues are predetermined and may be based on the design specification asdescribed in greater detail herein with respect to FIG. 6. According toaspects of the invention, REF_hi and REF_lo define respective upper andlower bounds of a tolerance margin for comparing FBK_mid to REF_mid, andthus for comparing FBK_ramp to REF_ramp.

In embodiments, the margin setter 310 b shown in FIG. 3a comprisesanalog circuitry that receives triangle wave signal FBK_ramp as an inputand generates signal FBK_mid as an output. FBK_mid is a triangle wavethat is equivalent in magnitude and period to FBK_ramp and including anydelay (e.g., time shift) of the margin setter 310 b. According toaspects of the invention, the margin setter 310 b uses identicalcircuitry as margin setter 310 a, such that the delay (e.g., time shift)of FBK_mid relative to FBK_ramp is the same as the delay (e.g., timeshift) of REF_mid relative to REF_ramp. In this manner, the marginsetter 310 b generates a comparison triangle wave (FBK_mid) based on afeedback triangle wave (FBK_ramp), wherein the comparison triangle wave(FBK_mid) may be a time-shifted copy of the feedback triangle wave(FBK_ramp).

Still referring to FIG. 3a , the comparators 315 a, 315 b and the ORgate 320 collectively determine whether FBK_mid is between REF_hi andREF_lo, which indicates whether FBK_ramp is deemed equal to REF_rampwithin the defined tolerance. In accordance with aspects of theinvention, FBK_mid has a value between REF_hi and REF_lo when REFCLK andFBKCLK are locked in frequency and phase within the predeterminedtolerance defined in the specification. Accordingly, the comparators 315a, 315 b and the OR gate 320 are structured an arranged to output asignal having a first value when FBK_mid is between REF_hi and REF_lo,and a second value when FBK_mid is outside of the band defined by REF_hiand REF_lo.

In embodiments, the comparators 315 a, 315 b each comprise analogcircuitry that performs the comparisons in real time. Specifically,REF_hi and FBK_mid are provided as inputs to the comparator 315 a. Theoutput 330 a of the comparator 315 a is a value of 1 when FBK_mid isgreater than REF_hi and a value of 0 at all other times. Thus, thecomparator 315 a is used to determine whether FBK_mid is greater thanREF_hi. Additionally, REF_lo and FBK_mid are provided as inputs to thecomparator 315 b. The output 330 b of the comparator 315 b is a value of1 when FBK_mid is less than REF_lo and a value of 0 at all other times.Thus, the comparator 315 b is used to determine whether FBK_mid is lessthan REF_lo.

The outputs 330 a, 330 b are provided as inputs to the OR gate 320. Inthis manner, the output 335 of the OR gate 320 has a value of 0 whenFBK_mid is between REF_hi and REF_lo, and a value of 1 when FBK_mid isoutside of the band defined between REF_hi and REF_lo. In this manner,the output 335 of the OR gate 320 has a first value (e.g., 0) whenREFCLK and FBKCLK are locked in frequency and phase within thepredetermined tolerance defined in the specification, and a second value(e.g., 1) when REFCLK and FBKCLK are not locked. In this manner, thecomparators 315 a, 315 b and the OR gate 320 collectively define adeterminer circuit that continuously compares a comparison triangle wave(i.e., FBK_mid) to a first margin signal (i.e., REF_hi) and a secondmargin signal (i.e., REF_lo), wherein the determiner circuit generates adeterminer output (i.e., the output 335 of the OR gate 320) based on thecomparing.

Still referring to FIG. 3a , the lock signal generation unit 325 isstructured and arranged to generate a lock signal “LOCK” indicating alock state after the output 335 of the OR gate 320 remains at the firstvalue (e.g., 0) for a predetermined amount of time. In embodiments, thelock signal generation unit 325 comprises an analog integrator 340 andan analog comparator 345. The integrator 340 receives the output 335 ofthe OR gate 320 at a reset input 350, and the inverse of the output 335of the OR gate 320 at a charge input 355. In this manner, when theoutput 335 of the OR gate 320 is 1 (e.g., the second value, whichindicates no lock), the integrator 340 is in reset mode such that theintegrator output “Vwait” is 0. Conversely, when the output 335 of theOR gate 320 is 0 (e.g., the first value, which indicates a lock), theintegrator 340 charges such that the integrator output Vwait increasesin value from 0 toward the saturation voltage (upper voltage) of theintegrator 340.

As shown in FIG. 3a , the integrator output Vwait is provided as a firstinput to the comparator 345. A predefined voltage “Vtimeout” is providedas the other input of the comparator 345. When Vwait is less thanVtimeout, the output of the comparator 345, i.e., the LOCK signal, has avalue of 0 which indicates that system lock is not achieved. When Vwaitgoes higher than Vtimeout due to continued integration of the integrator340, the output of the comparator 345 switches to a value of 1 whichindicates a system lock, i.e., that REFCLK and FBKCLK have remainedlocked for greater than a predetermined amount of time. In embodiments,the predetermined amount of time may be set by the designer and isdefined by the time constant of the integrator 340 and the value ofVtimeout. This predetermined amount of time corresponds to a wait timeduring which FBK_mid must remain between REF_hi and REF_lo in order toindicate a system lock (i.e., in order to drive the LOCK signal high).

Still referring to FIG. 3a , the integrator 340 remains in reset mode aslong as one of the comparators 315 a, 315 b fails its test case, i.e.,FBK_mid is greater than REF_hi or FBK_mid is less than REF_lo. Theintegrator 340 is in charge mode when both comparators 315 a, 315 b passtheir test case, i.e., REF_hi>FBK_mid>REF_lo. While the integrator 340is in charge mode, the value of Vwait increases from 0 toward thesaturation voltage (upper voltage) of the integrator 340. When theanalog value of Vwait goes higher than Vtimeout, the lock signal LOCKswitches to 1 which indicates a system lock condition. After achievingsystem lock, the circuit maintains LOCK at the high value (e.g., 1) aslong as Vwait remains higher than Vtimeout. However, in the event thatthe system goes out of a lock state (i.e., the frequency and/or phase ofFBKCLK changes compared to REFCLK), the value of FBK_mid is no longerwithin the bound defined by REF_hi and REF_lo, which results in theoutput 335 of OR gate 320 going high, which instantaneously causes theintegrator 340 to reset, which causes the comparator 345 to switch LOCKto a low value (e.g., 0) indicating no system lock. The system may goout of a lock state due to various events such as changes in REFCLKfrequency, increase in supply noise, and changes in supply voltageand/or temperature, for example. The loop of the PLL/DLL re-aligns to afrequency and phase match of FBKCLK and REFCLK when the PLL/DLL has hadtime to respond to the event that forced the out of lock condition, atwhich point the comparators 315 a, 315 b indicate passing values, whichcauses the integrator 340 to increase the value of Vwait until such atime as Vwait equals or exceeds Vtimeout and LOCK is again switched tothe high value.

The lock signal generation unit 325 of FIG. 3a is described as a purelyanalog circuit. However, implementations of the invention may alsoutilize a digital-based lock signal generation unit that uses a digitalcounter instead of an analog integrator. This can be accomplished, forexample, by starting a digital counter when the output 335 of the ORgate 320 switches to the low value (e.g., 0), which indicates afrequency and phase match of FBKCLK and REFCLK. The digital countercontinues to count as long a the output 335 remains high and until atimeout value is reached, at which point the LOCK signal is driven high.If, at any time, the output 335 of the OR gate 320 switches to the highvalue (e.g., 1) due to a frequency and/or phase mismatch between FBKCLKand REFCLK, then the digital counter resets and the LOCK signal isdriven to the low value.

FIG. 4 shows a block diagram of an exemplary ramp generator 400 inaccordance with aspects of the invention. The ramp generator 400 may beused as the ramp generators 305 a and 305 b as described with respect toFIG. 3a . In embodiments, the ramp generator 400 includes adivide-by-two circuit 405 with 50% duty cycle output followed by atriangle wave converter 410.

FIG. 5 shows an exemplary implementation of a triangle wave converter500 usable in aspects of the invention. The triangle wave converter 500may be used in the ramp generators described with respect to FIGS. 3aand 4. The triangle wave converter 500 may include a resistance, acapacitor, and an op-amp “A” connected between Vin and Vout as shown inFIG. 5. In this manner, the triangle wave converter 500 converts thesquare wave at Vin to a triangle wave at Vout. The invention is notlimited to the converter 500 shown in FIG. 5, and other suitablecircuits may be used to convert the square/sinusoidal reference clock toa triangle wave.

FIG. 6 shows a flow diagram of a method of phase error detection inaccordance with aspects of the invention. The method may be implemented,for example, using the lock detect circuit 300 described with respect toFIG. 3a . At step 605, the REFCLK waveform is received at the lockdetect circuit. The REFCLK waveform may be a reference clock of a PLL ora DLL having a square/sinusoidal wave shape. At step 610, the REFCLKwaveform is converted to a triangle waveform REF_ramp. Step 610 may beperformed by the ramp generator as described with respect to FIGS. 3a ,4, and 5, e.g., by ramping up and ramping down each adjacent cycle togenerate REF_ramp. At step 615, the REF_mid signal is generated based onREF_ramp. Step 615 may be performed by the margin setter 310 a asdescribed with respect to FIG. 3a . Step 615 optionally includesapplying a DC adjustment to REF_mid for the purpose of matching theoperational bounds of a downstream comparator.

At step 620, the REF_hi signal and the REF_lo signal are created basedon REF_mid. Step 620 may be performed in the manner described withrespect to FIG. 3a , e.g., by applying predetermined DC voltage offsets(e.g., Vup and Vdn) to the REF_mid signal. In embodiments, the values ofVup and Vdn are predetermined based on tolerance definitions that areset forth in the design specification for the PLL or DLL. The tolerancedefinitions may include a specified allowable phase offset equal to −Tdnto +Tup in seconds. The value of dv/dt is a given for a particular rampgenerator and frequency, such that a first upper limit is given asVup1=dv/dt*Tdn and a first lower limit is given as Vdn1=dv/dt*Tup. Thetolerance definitions may also include a specified allowable frequencyoffset as −Fdn to +Fup in hertz. The frequency of the reference clock isgiven as F, such that a minimum frequency is given as fmin=F−Fdn and amaximum frequency is given as fmax=F+Fup. The maximum period is thenTmax=1/fmin and the minimum period is then Tmin=1/fmax, such that asecond upper limit is given as Vup2=dv/dt*Tmax and a second lower limitis given as Vdn2=dv/dt*Tmin. In embodiments, the offset Vup is selectedas the greater of Vup1 and Vup2, and the offset Vdn is selected as thegreater of Vdn1 and Vdn2. In this manner, the offsets Vup, Vdn are usedto create the tolerance margin for the phase error detection circuit. Inanother embodiment, if just a phase detect and phase lock indication isrequired, then the offsets Vup1 and Vdn1 are used for Vup and Vdnrespectively. In another embodiment, if just a frequency detect andfrequency lock indication is required, then the offsets Vup2 and Vdn2are used for Vup and Vdn respectively.

Still referring to FIG. 6, at step 625 the FBKCLK waveform is receivedat the lock detect circuit. The FBKCLK waveform may be a feedback clockof a PLL or a DLL having a square/sinusoidal wave shape. At step 630,the FBKCLK waveform is converted to a triangle waveform FBK_ramp. Step630 may be performed by the ramp generator as described with respect toFIGS. 3a , 4, and 5, e.g., by ramping up and ramping down each adjacentcycle to generate FBK_ramp. In embodiments, steps 610 and 630 areperformed using substantially identical ramp generators, as describedwith respect to FIG. 3a . At step 635, the FBK_mid signal is generatedbased on FBK_ramp. Step 635 may be performed by the margin setter 310 bas described with respect to FIG. 3a . Step 635 optionally includesapplying a DC voltage adjustment to FBK_mid for the purpose of matchingthe DC level of FBK_mid to that of REF_mid.

At step 640, it is determined whether the instantaneous value of FBK_midis less than REF_hi and greater than REF_lo, i.e., whether FBK_mid iswithin the tolerance margin defined by REF_hi and REF_lo. Step 640 maybe performed by the comparators 315 a, 315 b and the OR gate 320described with respect to FIG. 3a . When FBK_mid is not between REF_hiand REF_lo at step 640, then at step 645 the LOCK signal is driven tothe low value (e.g., 0) which indicates that there is not system lock.

When FBK_mid is between REF_hi and REF_lo at step 640, then at step 650a wait time Twait is waited. At step 655, it is determined whether thevalue of Vwait is greater than or equal to a value of Vtimeout. Inembodiments, Vwait is the output value of the integrator 340 of the locksignal generation unit 325 described with respect to FIG. 3a , and Twaitand Vtimeout are defined in the design specification of the PLL or DLL.For example, Twait may be specified as the raw time in seconds or numberof cycles of REFCLK, and Vtimeout may be specified such that it is lessthan or equal to the saturation voltage of the integrator (e.g.,integrator 340 of FIG. 3a ). In this manner, the dv/dt value of theintegrator is calculated as Vtimeout/Twait. When Vwait is less thanVtimeout at step 655, then the LOCK signal is driven to the low value atstep 645. On the other hand, when Vwait is greater than or equal toVtimeout at step 655, then the LOCK signal is drive to the high value atstep 660, which indicates a system lock. Steps 645, 650, 655, and 660may be performed by the lock signal generation unit 325 described withrespect to FIG. 3 a.

In accordance with an aspect of the invention, a method of lockdetection includes converting the time period information of a referenceclock (REFCLK) into a voltage value by way of integration (ramp-up) fora cycle and de-integration (ramp-down) for the next cycle. The methodincludes converting the time period information of a feedback clock(FBKCLK) into a voltage value by way of integration of similarcharacteristics (ramp-up) for a cycle and de-integration of similarcharacteristics (ramp-down) for the next cycle. The method includescreating a voltage varying upper limit (REF_hi) and lower limit (REF_lo)of the converted reference clock based on a user defined tolerancemargin such that these limits track the converted reference clock inreal-time with DC-shifts. The method includes comparing the convertedfeedback clock continuously to the upper and lower limits to determinewhether the converted feedback clock is within the limits. When theconverted feedback clock is within the bounds defined by the upper andlower limits, the method further includes waiting a predetermined amountof time to signify frequency and phase match, after which the methodrepeats. The predetermined amount of time is a wait scheme implementedalso by an integration and whose characteristics have a much longer timeconstant than that associated with the reference clock and the feedbackclock. When the converted feedback clock is outside the bounds definedby the upper and lower limits, the method further includes indicating anun-lock state.

In accordance with an aspect of the invention, a circuit for lockdetection includes a ramp generator that converts a reference clock(REFCLK) to a triangle wave profile (REF_ramp) such that ramp-up is onetime period and ramp-down is the adjacent time period. The circuitincludes an identical ramp generator that converts a feedback clock(FBKCLK) to a triangle wave profile (FBK_ramp). The circuit includes amargin setting structure to create upper and lower voltage tolerancelevels (REF_hi) and lower limit (REF_lo) that track with REF_ramp. Thecircuit includes a second optional margin setting structure, identicalto the first margin setting structure, to process FBK_ramp for matchingdelay as well as match the DC level of REF_ramp. The circuit includes aset of comparators to check whether FBK_ramp lies within the upper andlower tolerance levels at any given time, and generate a logic flag whennot within the tolerance levels. The circuit includes an integrator witha long time constant that is reset each time the logic flag happens,signifying an unlocked condition. The integrator is otherwise inintegration mode increasing its output value toward a predeterminedvoltage (Vtimeout). The circuit includes a comparator to signify a locksignal when the output voltage of the integrator is more than thepredetermined voltage corresponding to a wait time.

The circuits of the present invention can be implemented insemiconductor structures, which can be manufactured in a number of waysusing a number of different tools. In general, though, the methodologiesand tools are used to form the semiconductor implementations withdimensions in the micrometer and nanometer scale. The methodologies,i.e., technologies, employed to manufacture the semiconductorimplementations have been adopted from integrated circuit (IC)technology. For example, the semiconductor implementations are built onwafers and are realized in films of material patterned byphotolithographic processes on the top of a wafer. In particular, thefabrication of the semiconductor implementations uses three basicbuilding blocks: (i) deposition of thin films of material on asubstrate, (ii) applying a patterned mask on top of the films byphotolithographic imaging, and (iii) etching the films selectively tothe mask.

The method as described above is used in the fabrication of integratedcircuit chips. The resulting integrated circuit chips can be distributedby the fabricator in raw wafer form (that is, as a single wafer that hasmultiple unpackaged chips), as a bare die, or in a packaged form. In thelatter case the chip is mounted in a single chip package (such as aplastic carrier, with leads that are affixed to a motherboard or otherhigher level carrier) or in a multichip package (such as a ceramiccarrier that has either or both surface interconnections or buriedinterconnections). In any case the chip is then integrated with otherchips, discrete circuit elements, and/or other signal processing devicesas part of either (a) an intermediate product, such as a motherboard, or(b) an end product. The end product can be any product that includesintegrated circuit chips, ranging from toys and other low-endapplications to advanced computer products having a display, a keyboardor other input device, and a central processor.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

What is claimed is:
 1. A method of lock detection comprising, using ananalog circuit to: convert a reference clock to a reference trianglewave; convert a feedback clock to a feedback triangle wave; determinewhether the feedback triangle wave is within a tolerance margin that isdefined relative to the reference triangle wave; and generate adeterminer output that is a first value when the feedback triangle waveis not within the tolerance margin, and a second value when the feedbacktriangle wave is within the tolerance margin.
 2. The method of claim 1,wherein: the reference clock is a first square wave or sinusoidal waveclock; and the feedback clock is a second square wave or sinusoidal waveclock.
 3. The method of claim 2, wherein the reference clock and thefeedback clock are part of a phase lock loop (PLL) or a delay lock loop(DLL).
 4. The method of claim 1, wherein the analog circuit comprises: afirst ramp generator that performs the converting the reference clock tothe reference triangle wave; and a second ramp generator that performsthe converting the feedback clock to the feedback triangle wave.
 5. Themethod of claim 4, wherein the first ramp generator is identical to thesecond ramp generator.
 6. The method of claim 1, wherein the analogcircuit comprises: a first margin setter that generates: a first signalthat defines an upper bound of the tolerance margin, and a second signalthat defines a lower bound of the tolerance margin; and a second marginsetter that, prior to the determining, applies a time shift to thefeedback triangle wave equal to a time shift associated with the firstmargin setter.
 7. The method of claim 6, wherein the first margin setteris identical to the second margin setter.
 8. The method of claim 1,wherein the analog circuit comprises a pair of comparators and an ORgate that are structured and arranged to perform the determining whetherthe feedback triangle wave is within the tolerance margin.
 9. The methodof claim 1, wherein: the analog circuit further comprises an analogintegrator and a comparator that are structured and arranged to generatea lock detect signal based on the determiner output; the lock detectsignal is a first level when the determiner output is the first value;and the lock detect signal is a second value when the determiner outputis the second value for a predetermined amount of time.
 10. The methodof claim 1, further comprising using the analog circuit to generate alock detect signal based on the determiner output.
 11. The method ofclaim 10, wherein the generating the lock detect signal comprises:setting the lock detect signal to a first value when a comparisontriangle wave is not between a first margin signal and a second marginsignal; and setting the lock detect signal to a second value when thecomparison triangle wave is between the first margin signal and thesecond margin signal for a predetermined amount of time.
 12. The methodof claim 1, wherein the determining whether the feedback triangle waveis within the tolerance margin is performed in real time.
 13. The methodof claim 1, wherein the converting the reference clock and theconverting the feedback clock comprise translations that maintainfrequency and phase relationships of the reference clock and thefeedback clock.